package com.enation.app.shop.front.policyInsurance.service.impl;

import com.enation.app.shop.front.policyInsurance.entity.PropectRecord;
import com.enation.app.shop.front.policyInsurance.service.PropectRecordMapper;
import com.enation.framework.database.IDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class PropectRcord implements PropectRecordMapper {
    @Autowired
    private IDaoSupport iDaoSupport;
    @Override
    public int addPropectRecord(PropectRecord propectRecord) {
        this.iDaoSupport.insert("rbt_prospect_record",propectRecord);
        return 1;
    }

    @Override
    public PropectRecord getPropectRecordInfo(int warranty_id) {
        String sql = "select * from rbt_prospect_record p where p.warranty_id = ?";
        return this.iDaoSupport.queryForList(sql,PropectRecord.class,warranty_id).get(0);
    }
}
